Skip to content

MOBILE-4901: Update @ngx-translate to version 17#4650

Merged
dpalou merged 7 commits intomoodlehq:mainfrom
crazyserver:MOBILE-4901
Jan 27, 2026
Merged

MOBILE-4901: Update @ngx-translate to version 17#4650
dpalou merged 7 commits intomoodlehq:mainfrom
crazyserver:MOBILE-4901

Conversation

@crazyserver
Copy link
Copy Markdown
Member

No description provided.

@crazyserver crazyserver force-pushed the MOBILE-4901 branch 10 times, most recently from 604b288 to ec52c86 Compare December 4, 2025 11:02
@crazyserver crazyserver requested a review from Copilot January 14, 2026 15:49
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR upgrades the @ngx-translate library from version 16 to 17 and refactors the translation loading system to implement a custom MoodleTranslateLoader class.

Changes:

  • Migrated from TranslateModule to TranslatePipe and provideTranslateService following ngx-translate v17 standalone API patterns
  • Implemented custom MoodleTranslateLoader to centralize translation loading, parent language merging, and custom/site plugin string management
  • Refactored custom language strings and site plugin strings handling to use the new loader architecture
  • Updated test utilities to reflect API changes (onDefaultLangChangeonFallbackLangChange)

Reviewed changes

Copilot reviewed 13 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/testing/utils.ts Updated mock and imports for ngx-translate v17 API changes
src/main.ts Replaced TranslateModule.forRoot() with provideTranslateService() and removed factory function
src/core/tests/behat/language.feature Expanded language tests to include parent language and custom string scenarios
src/core/tests/behat/customlangstrings.feature Removed file (tests merged into language.feature)
src/core/singletons/countries.ts Added constant for translation key prefix and refactored to use new getMessages API
src/core/services/lang.ts Major refactor to delegate translation management to MoodleTranslateLoader
src/core/features/siteplugins/services/siteplugins.ts Updated type definition for parsed language strings
src/core/features/siteplugins/services/siteplugins-init.ts Updated to use new addSitePluginsStrings API signature
src/core/features/mainmenu/pages/reload/reload.ts Changed from ngOnInit to ionViewDidEnter lifecycle hook
src/core/classes/lang-loader.ts New file implementing MoodleTranslateLoader class
src/core/base.module.ts Replaced TranslateModule.forChild() with standalone TranslatePipe
package.json Updated ngx-translate dependencies to v17
cordova-plugin-moodleapp/package.json Updated esbuild dependency
Files not reviewed (1)
  • cordova-plugin-moodleapp/package-lock.json: Language not supported

Comment thread src/core/services/lang.ts Outdated
Comment thread src/core/classes/lang-loader.ts Outdated
@crazyserver crazyserver changed the title Mobile 4901 MOBILE-4901: Update @ngx-translate to version 17 Jan 14, 2026
@crazyserver crazyserver force-pushed the MOBILE-4901 branch 2 times, most recently from b832a5f to b9afed5 Compare January 20, 2026 12:32
Copilot AI review requested due to automatic review settings January 20, 2026 12:32
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 13 changed files in this pull request and generated 2 comments.

Comment thread src/core/services/lang.ts Outdated
Comment thread src/core/classes/lang-loader.ts Outdated
@crazyserver crazyserver marked this pull request as ready for review January 20, 2026 12:57
Copilot AI review requested due to automatic review settings January 20, 2026 12:57
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 13 changed files in this pull request and generated 2 comments.

Comment thread src/core/singletons/countries.ts
Comment thread src/core/services/lang.ts Outdated
@crazyserver crazyserver force-pushed the MOBILE-4901 branch 2 times, most recently from ebeca30 to 5b92f79 Compare January 20, 2026 14:44
Copilot AI review requested due to automatic review settings January 20, 2026 14:44
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 13 changed files in this pull request and generated 3 comments.

Comment thread src/core/services/lang.ts
Comment thread src/core/classes/lang-loader.ts Outdated
Comment thread src/core/tests/behat/language.feature
Comment thread src/core/services/lang.ts
Comment thread src/core/services/lang.ts
Comment thread src/core/services/lang.ts Outdated
Comment thread src/core/services/lang.ts Outdated
Comment thread src/core/classes/lang-loader.ts Outdated
Comment thread src/core/services/lang.ts Outdated
Comment thread src/core/classes/lang-loader.ts Outdated
Comment thread src/core/classes/lang-loader.ts Outdated
Comment thread src/core/classes/lang-loader.ts Outdated
Comment thread src/core/tests/behat/language.feature Outdated
Copilot AI review requested due to automatic review settings January 26, 2026 11:22
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 13 changed files in this pull request and generated 2 comments.

Comment thread src/core/services/lang.ts
Comment thread src/core/services/lang.ts
@dpalou dpalou enabled auto-merge January 27, 2026 11:12
@dpalou dpalou merged commit 529a35f into moodlehq:main Jan 27, 2026
45 checks passed
@crazyserver crazyserver deleted the MOBILE-4901 branch January 27, 2026 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants